﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace PlaylistParity
{
    public class Song : BaseModel
    {
        /// <summary>
        /// The <see cref="Name" /> property's name.
        /// </summary>
        public const string NamePropertyName = "Name";

        private string _name = string.Empty;

        /// <summary>
        /// Gets the Name property.
        /// TODO Update documentation:
        /// Changes to that property's value raise the PropertyChanged event. 
        /// This property's value is broadcasted by the Messenger's default instance when it changes.
        /// </summary>
        public string Name
        {
            get
            {
                return _name;
            }

            set
            {
                if (_name == value)
                {
                    return;
                }

                var oldValue = _name;
                _name = value;

                // Update bindings, no broadcast
                RaisePropertyChanged(NamePropertyName);
            }
        }

        /// <summary>
        /// The <see cref="Location" /> property's name.
        /// </summary>
        public const string LocationPropertyName = "Location";

        private string _location = null;

        /// <summary>
        /// Gets the Location property.
        /// TODO Update documentation:
        /// Changes to that property's value raise the PropertyChanged event. 
        /// This property's value is broadcasted by the Messenger's default instance when it changes.
        /// </summary>
        public string Location
        {
            get
            {
                return _location;
            }

            set
            {
                if (_location == value)
                {
                    return;
                }

                var oldValue = _location;
                _location = value;

                // Update bindings, no broadcast
                RaisePropertyChanged(LocationPropertyName);
            }
        }

        /// <summary>
        /// The <see cref="TrackID" /> property's name.
        /// </summary>
        public const string TrackIDPropertyName = "TrackID";

        private int _trackID = -1;

        /// <summary>
        /// Gets the TrackID property.
        /// TODO Update documentation:
        /// Changes to that property's value raise the PropertyChanged event. 
        /// This property's value is broadcasted by the Messenger's default instance when it changes.
        /// </summary>
        public int TrackID
        {
            get
            {
                return _trackID;
            }

            set
            {
                if (_trackID == value)
                {
                    return;
                }

                var oldValue = _trackID;
                _trackID = value;

                // Update bindings, no broadcast
                RaisePropertyChanged(TrackIDPropertyName);
            }
        }

        /// <summary>
        /// The <see cref="Album" /> property's name.
        /// </summary>
        public const string AlbumPropertyName = "Album";

        private string _album = string.Empty;

        /// <summary>
        /// Gets the Album property.
        /// TODO Update documentation:
        /// Changes to that property's value raise the PropertyChanged event. 
        /// This property's value is broadcasted by the Messenger's default instance when it changes.
        /// </summary>
        public string Album
        {
            get
            {
                return _album;
            }

            set
            {
                if (_album == value)
                {
                    return;
                }

                var oldValue = _album;
                _album = value;

                // Update bindings, no broadcast
                RaisePropertyChanged(AlbumPropertyName);
            }
        }

        /// <summary>
        /// The <see cref="Artist" /> property's name.
        /// </summary>
        public const string ArtistPropertyName = "Artist";

        private string _artist = string.Empty;

        /// <summary>
        /// Gets the Artist property.
        /// TODO Update documentation:
        /// Changes to that property's value raise the PropertyChanged event. 
        /// This property's value is broadcasted by the Messenger's default instance when it changes.
        /// </summary>
        public string Artist
        {
            get
            {
                return _artist;
            }

            set
            {
                if (_artist == value)
                {
                    return;
                }

                var oldValue = _artist;
                _artist = value;

                // Update bindings, no broadcast
                RaisePropertyChanged(ArtistPropertyName);
            }
        }
    }
}
